package com.mryao.gxkygl.common.base.controller;

import com.mryao.gxkygl.common.aop.AutoErrorhandler;
import com.mryao.gxkygl.common.base.service.SyslogService;
import com.mryao.gxkygl.common.query.Query;
import com.mryao.gxkygl.common.result.PageResult;
import com.mryao.gxkygl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api("系统日志")
@RestController
@RequestMapping("syslog")
public class SyslogController {
    @Autowired
    private SyslogService syslogService;

    @ApiOperation(value = "日志查询")
    @GetMapping(value = "/query")
    @AutoErrorhandler("GET:/syslog/query")
    public Result selectlog(Query query){
        PageResult pageResult = syslogService.queryPage(query);
        return Result.getSuccess(pageResult);
    }

}
